import Vue from 'vue'
import App from './App'
import Lib from './lib'
import MyUtils from './lib/utils/index'
import music from './lib/music'

Vue.config.productionTip = false

App.mpType = 'app'
Vue.prototype.$lib = Lib;
Vue.prototype.$myUtils = MyUtils // utils, 包含表单验证、错误处理、页面跳转、消息提示
Vue.prototype.$music = music;

// #ifndef H5
var gaudioctx=uni.getBackgroundAudioManager()
// #endif
// #ifdef H5
var gaudioctx=uni.createInnerAudioContext()
// #endif
Vue.prototype.$audio = gaudioctx

import RouterMount from '././lib/useRouter.js'
import routerLink from '././lib/router-link.vue'
Vue.component('router-link', routerLink)

// 在main.js注册全局组件
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
Vue.component('mescroll-body', MescrollBody)
Vue.component('mescroll-uni', MescrollUni)

Vue.prototype.$navigateBack = function () {
  uni.navigateBack({
      delta: 1
  });
}

const store = Lib.$store;
const app = new Vue({
	    store,
    ...App
})
// #ifdef H5
RouterMount(app,'#app');
// #endif

// #ifndef H5
app.$mount();
// #endif
